from typing import *


class Solution:
    def maxAdjacentDistance(self, nums: List[int]) -> int:
        ans = abs(nums[-1] - nums[0])
        for i in range(1, len(nums)):
            ans = max(ans, abs(nums[i] - nums[i - 1]))
        return ans


s = Solution()
print(s.maxAdjacentDistance([1, 2, 4]))
